package com.xvyy.tingshu.account.mapper;

import com.xvyy.tingshu.model.account.UserAccountDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserAccountDetailMapper extends BaseMapper<UserAccountDetail> {

    @Select("        select *\n" +
            "        from user_account_detail\n" +
            "        where user_id = #{userId}\n" +
            "          and trade_type = #{type}\n" +
            "          and is_deleted = 0")
    IPage<UserAccountDetail> findUserConsumePage(@Param("iPage") IPage<UserAccountDetail> iPage, @Param("userId") Long userId, @Param("type") String type);
}
